\usepackage{xparse}

\newmdenv[backgroundcolor=white]{cbox}

\ExplSyntaxOn
\NewDocumentEnvironment{formation}{m m}
{\begin{minipage}{\textwidth}\begin{cbox}[backgroundcolor=#1,linecolor=#1]\centering\begin{minipage}{0.10\textwidth}\footnotesize{#2}\end{minipage}\hfill\begin{minipage}[t]{0.88\textwidth}\footnotesize}
{\end{minipage}\end{cbox}\end{minipage}}
\ExplSyntaxOff

\ExplSyntaxOn
\NewDocumentEnvironment{internship}{m m}
{\begin{minipage}{\textwidth}\begin{cbox}[backgroundcolor=#1,linecolor=#1]\centering\begin{minipage}{0.18\textwidth}\footnotesize{#2}\end{minipage}\hfill\begin{minipage}[t]{0.81\textwidth}\footnotesize}
{\end{minipage}\end{cbox}\end{minipage}}
\ExplSyntaxOff

\ExplSyntaxOn
\NewDocumentEnvironment{projet}{m m}
{\begin{minipage}{\textwidth}\begin{cbox}[backgroundcolor=#1,linecolor=#1]\centering\begin{minipage}{0.1\textwidth}\footnotesize{#2}\end{minipage}\hfill\begin{minipage}[t]{0.89\textwidth}\footnotesize}
{\end{minipage}\end{cbox}\end{minipage}}
\ExplSyntaxOff

\ExplSyntaxOn
\NewDocumentEnvironment{technicalSkill}{m}
{\begin{minipage}{\textwidth}\centering\begin{minipage}{0.19\textwidth}\footnotesize\texttt{#1}\end{minipage}\hfill\begin{minipage}[t]{0.8\textwidth}\footnotesize}
{\end{minipage}\end{minipage}}
\ExplSyntaxOff

\ExplSyntaxOn
\NewDocumentEnvironment{additionalExp}{m}
{\begin{minipage}{\textwidth}\centering\begin{minipage}{0.10\textwidth}\footnotesize{#1}\end{minipage}\hfill\begin{minipage}[t]{0.89\textwidth}\footnotesize}
{\end{minipage}\end{minipage}}
\ExplSyntaxOff

% Pour tracer des lignes horizontales
\renewcommand*{\hrulefill}[2][0pt]{\leavevmode \leaders \hbox to 1pt{\rule[#1]{1pt}{#2}} \hfill \kern 0pt}
